#ifndef __HELPER_FUNCTIONS
#define __HELPER_FUNCTIONS

#include "xuwb_factor.h"
#include "xuwb_variable.h"
#include "xbram.h"
#include "env_config.h"

typedef union {
	long unsigned int u;
	float f;
} data_t;

#define MAX_Times 10
extern u32 tUsed[MAX_Times];

int Factors_Init(XUwb_factor* factors, int len);
//int Factors_Release(XUwb_factor*, int);

int Variables_Init(XUwb_variable*, int);
//int Variables_Release(XUwb_variable*, int);

int Brams_Init(XBram* brams, int len);
//void Bram_Release(void* map_base, int fd);
int Bram_Write_helper(XBram* bram, struct Pmf*, int len);
int Bram_Read_helper(XBram* bram, struct Pmf*, int len);

void XTime_rst();
void XTime_mask(int index);
u32 XTime_trigger(int index_b, int index_e);

#endif // __HELPER_FUNCTIONS
